package com.xiaolei.libraryktx

import android.content.res.Resources
import android.util.TypedValue
import com.xiaolei.library.Utils.ByteArrayUtil

inline fun Float.toByteArray() = ByteArrayUtil.float2ByteArray(this)

inline val Float.dp: Float
    get() = TypedValue.applyDimension(
        TypedValue.COMPLEX_UNIT_DIP,
        this,
        Resources.getSystem().displayMetrics
    )

inline val Float.sp: Float
    get() = TypedValue.applyDimension(
        TypedValue.COMPLEX_UNIT_SP,
        this,
        Resources.getSystem().displayMetrics
    )